<#import "/layout.html" as c>
<@c.html title="Index"> 
  <!-- 开始页面内容 -->
  <div id="content" class="content"> 
    <!-- 开始面包屑导航 -->
    <ol class="breadcrumb pull-right">
      <li class="">首页</li>
      <#list menuState.breadCrumbList as breadCrumb>
      <li class="">${breadCrumb}</li>
      </#list>
    </ol>
    <!-- 结束面包屑导航 --> 
    <!-- 开始页头区域 --> 
    <#if role??>
        <h1 class="page-header">编辑角色<small>编辑管理员角色</small></h1>
        <input type="hidden" id="roleId" value="${role.id}"/>
    <#else>
        <h1 class="page-header">新增角色<small>添加新的管理员角色</small></h1>
    </#if>

      <div class="row">
          <div class="col-md-12">
              <div class="panel panel-inverse" data-sortable-id="form-validation-1">
                  <div class="panel-heading">
                      <div class="panel-heading-btn"> <a href="#listTip" class="btn btn-xs btn-icon btn-circle btn-info" role="button" data-toggle="collapse" aria-expanded="true" title="操作提示"> <i class="fa fa-lightbulb-o"></i> </a> <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"> <i class="fa fa-expand"></i> </a> <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"> <i class="fa fa-minus"></i> </a> </div>
                      <h4 class="panel-title">编辑角色</h4>
                  </div>
                  <div class="panel-body">
                      <!-- 开始操作提示 -->
                      <div class="alert alert-info collapse in" role="tabpanel" id="listTip">
                          <h4>操作提示</h4>
                          <ul>
                              <li>可在标题处全选所有功能或根据功能模块逐一选择操作权限，提交保存后生效。</li>
                          </ul>
                      </div>
        <!--结束操作提示 -->
        <!-- 开始基础设置表单 -->
        <form class="form-horizontal form-bordered"
                      data-parsley-validate="true" id="form" name="form"
                      data-parsley-excluded=":checkbox"
                      method="POST" action="${adminRoot}role/json/save" onsubmit="return false;">
          <#if role??>
          <input type="hidden" name="id" value="${role.id}" />
          </#if>
          <input type="hidden" id="permission" name="permission" value=""/>
          <div class="form-group">
            <label for="name" class="control-label col-lg-2 col-md-3 col-sm-3"> 角色 <i class="f-s-14 text-danger">*</i> &nbsp;: </label>
            <div class="col-lg-6 col-md-7 col-sm-8">
              <input type="text" id="name" name="name" value="<#if role??>${role.name}</#if>" class="form-control" data-parsley-required="true"/>
            </div>
          </div>
          <div class="form-group">
            <label for="name" class="control-label col-lg-2 col-md-3 col-sm-3"> 授权 <i class="f-s-14 text-danger">*</i> &nbsp;: </label>
              <div class="col-lg-6 col-md-7 col-sm-8">
                  <ul id="menuTree" class="ztree"></ul>
              </div>
          </div>
          <div class="form-group">
            <label class="control-label col-lg-2 col-md-3 col-sm-3"></label>
            <div class="col-lg-6 col-md-7 col-sm-8">
                <a id="formSubmit" href="javascript:;" class="btn btn-primary" data-q-text="Loading..." nc-q-submit-target="form" data-permission="" nc-q-submit-reload="true"> 提交设置 </a> </div>
          </div>
        </form>
        <!-- 结束基础设置表单 --> 
      </div>
    </div>
  </div>
  <!-- 结束页面内容 --> 
  <script src="${jsRoot}admin/role.add.js"></script >
</@c.html>
